package org.yenn.pattern.aliyun.j2ee.mvc;

import lombok.AllArgsConstructor;
import org.yenn.pattern.aliyun.j2ee.entity.Student;

/**
 * 步骤 3
 * 创建控制器。
 */
@AllArgsConstructor
public class StudentController {
    private Student model;
    private StudentView view;

    public void setStudentName(String name) {
        model.setName(name);
    }

    public String getStudentName() {
        return model.getName();
    }

    public void setStudentRollNo(int rollNo) {
        model.setRollNo(rollNo);
    }

    public int getStudentRollNo() {
        return model.getRollNo();
    }

    public void updateView() {
        view.printStudentDetails(model.getName(), model.getRollNo());
    }
}